<?php
require("gConfig.php");
$uid = $_GET['uid'];
if ( $uid == "" )
{
	exit( );
}
checkuid($uid,5);

$config = getBetConfig($MyData['Name']);
echo "{";
$outstr = "";
foreach ($config as $k=>$v){
	$outstr .= "\"{$k}\":\"{$v}\",";
}
$outstr = substr($outstr, 0,strlen($outstr)-1);
echo $outstr;
echo "}";

function getBetConfig($name){
	global $comm;
	
	$query = "select gTree,gGame1 from b_group where gName={$name}";
	$result = mysql_query($query,$comm);
	$row = mysql_fetch_row($result);
	$tree = explode(",", $row[0]);
	$betboss = $tree[1];
	$ss = explode(",", $row[1]);
	
	$query = "select gGame1 from b_group where gName={$betboss} and gLevel = 1 ";
	$result = mysql_query($query,$comm);
	$row = mysql_fetch_row($result);
	$s = explode( ",", $row[0] );
	$betconfig["water"] = $s[0];
	$betconfig["minbet"] = $s[1];//最小 
	$betconfig["maxbet1"] = $s[2];//庄闲最大
	$betconfig["maxbet2"] = $s[3];//和局最大
	$betconfig["maxbet3"] = $s[4];//对子最大
	$betconfig["limit1"] = $s[5];//群组限押设定
	$betconfig["limit2"] = $s[6];
	$betconfig["limit3"] = $s[7];
	$betconfig["room"] = $s[8];
	$betconfig["betmode"] = $s[12];
	$betconfig["mag1"] = $s[13];//倍数
	$betconfig["mag2"] = $s[14];
	$betconfig["mag3"] = $s[15];
	$betconfig["nobet1"] = $s[16];//未押次数
	$betconfig["nobet2"] = $s[17];//可押倍数
	$betconfig["nobet3"] = $s[18];//庄闲差距
	$betconfig["nobet4"] = $s[19];//差距次数
	$betconfig["nobet5"] = $s[20];//可押倍数
	$betconfig["maxbet4"] = $s[21];
	$betconfig["limit4"] = $s[22];
	$betconfig["mag4"] = $s[23];
	//覆盖总代理得参数
	$betconfig["water"] = $ss[0];
	$betconfig["maxbet1"] = $ss[2];//庄闲最大
	$betconfig["maxbet2"] = $ss[3];//和局最大
	$betconfig["maxbet3"] = $ss[4];//对子最大
	$betconfig["maxbet4"] = $ss[5];//大小最大
	//获取房间号
	$query = "select uId from m_users where uName={$name}";
	$result = mysql_query($query,$comm);
	$row = mysql_fetch_row($result);
	$room = $row[0];
	
	//根据房间号取得 限制参数
	$query = "select cRoom1 from b_config";
	$result = mysql_query($query,$comm);
	$row = mysql_fetch_row($result);
	$sss = explode("|", $row[0]);
	
	$betconfig["roomminbet"] = $sss[1];//庄闲最大
	$betconfig["roommaxbet1"] = $sss[2];//庄闲最大
	$betconfig["roommaxbet2"] = $sss[3];//和局最大
	$betconfig["roommaxbet3"] = $sss[4];//对子最大
	$betconfig["roommaxbet4"] = $sss[28];//大小最大
	$betconfig["roomallbet1"] = $sss[5];//庄闲最大
	$betconfig["roomallbet2"] = $sss[6];//和局最大
	$betconfig["roomallbet3"] = $sss[7];//对子最大
	$betconfig["roomallbet4"] = $sss[29];//大小最大
	
	return $betconfig;
}

?>